/*
 * @Author: sdq 483657864@qq.com
 * @Date: 2025-04-18 10:06:00
 * @LastEditors: sdq 483657864@qq.com
 * @LastEditTime: 2025-04-19 10:12:30
 * @FilePath: \ranyu_anchor_new\src\agroa\listenter\userPublished.ts
 * @Description: 初始化客户端
 */
import AgoraRTC, { IAgoraRTCClient } from "agora-rtc-sdk-ng";
import { shallowRef } from "vue";
/**
 * @description 客户端实例，后续需要操作的对象（浅层响应式）
 */
const agoraClient = shallowRef<IAgoraRTCClient | null>();
/**
 * 初始化 Agora RTC SDK
 * @throws 初始化失败时抛出错误
 */
const initialize = () => {
  agoraClient.value = AgoraRTC.createClient({
    mode: "live",
    codec: "vp8",
  });
};
export { agoraClient, initialize };
